-
Notifications
You must be signed in to change notification settings - Fork 21
feat: Add OpenTelemetry instrumentation for Google ADK (rebased from PR #57) #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ralf0131
wants to merge
21
commits into
main
Choose a base branch
from
copilot/rebase-onto-latest-main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instrumentation-loongsuite/loongsuite-instrumentation-google-adk/examples/main.py
Dismissed
Show dismissed
Hide dismissed
Cirilla-zmh
reviewed
Dec 2, 2025
instrumentation-loongsuite/loongsuite-instrumentation-google-adk/pyproject.toml
Outdated
Show resolved
Hide resolved
instrumentation-loongsuite/loongsuite-instrumentation-google-adk/pyproject.toml
Show resolved
Hide resolved
instrumentation-loongsuite/loongsuite-instrumentation-google-adk/pyproject.toml
Outdated
Show resolved
Hide resolved
instrumentation-loongsuite/loongsuite-instrumentation-google-adk/pyproject.toml
Outdated
Show resolved
Hide resolved
instrumentation-loongsuite/loongsuite-instrumentation-google-adk/pyproject.toml
Outdated
Show resolved
Hide resolved
...trumentation-google-adk/src/opentelemetry/instrumentation/google_adk/internal/_extractors.py
Show resolved
Hide resolved
...trumentation-google-adk/src/opentelemetry/instrumentation/google_adk/internal/_extractors.py
Outdated
Show resolved
Hide resolved
| _logger.exception(f"Error extracting tool attributes: {e}") | ||
| return self.extract_common_attributes("execute_tool") | ||
|
|
||
| def _extract_provider_name(self, model_name: str) -> str: |
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not reasonable to extract provider name from the model name - providers may host different models. I will create a common converter in "genai-util" and will replace this implementation soon. So feel free to leave it here.
...umentation-loongsuite/loongsuite-instrumentation-google-adk/tests/test_plugin_integration.py
Outdated
Show resolved
Hide resolved
...umentation-loongsuite/loongsuite-instrumentation-google-adk/tests/test_plugin_integration.py
Show resolved
Hide resolved
Co-authored-by: ralf0131 <[email protected]>
Co-authored-by: ralf0131 <[email protected]>
- Add package.py to define instrumentation metadata - Update instrumentation-genai/README.md with google-adk entry - Fixes CI generate task failure Change-Id: I2534d42f3d6538a4842d3b19b449e927685371e3 Co-developed-by: Cursor <[email protected]>
- Add google-adk >= 0.1.0 to libraries list - Generated by running scripts/generate_instrumentation_bootstrap.py - Fixes CI generate check failure Change-Id: I9c80405105cc795c8a2c66d7bb02b5e1934e81e9 Co-developed-by: Cursor <[email protected]>
- Rename from opentelemetry-instrumentation-google-adk to loongsuite-instrumentation-google-adk - Move from instrumentation-genai/ to instrumentation-loongsuite/ - Update pyproject.toml with loongsuite naming conventions - Change package name to loongsuite-instrumentation-google-adk - Use dynamic version from version.py - Update authors to LoongSuite Python Agent Authors - Update homepage URL to point to specific subdirectory - Update instrumentation-genai/README.md (remove google-adk entry) - Update instrumentation-loongsuite/README.md (add google-adk entry) - Update bootstrap_gen.py (remove google-adk as it's now loongsuite-specific) This aligns google-adk with other loongsuite-specific instrumentations. Change-Id: Ia1c1807731cb5ba8ba8ada0632a749dedd8a453b Co-developed-by: Cursor <[email protected]>
Change-Id: I088389a1c453e068e29bdd64f5e18f5bcce60787 Co-developed-by: Cursor <[email protected]>
- Introduced a global instance of GoogleAdkObservabilityPlugin to facilitate both manual and auto instrumentation. - Updated the GoogleAdkInstrumentor to utilize the global plugin, ensuring consistent observability across multiple instances. - Added a wrapper function for Runner initialization to automatically inject the observability plugin. - Improved documentation for usage and functionality of the instrumentation methods. This update streamlines the instrumentation process and enhances compatibility with various usage scenarios. Change-Id: I8a7934626fd8e8deac1f595da66174b6ca8dd7bb Co-developed-by: Cursor <[email protected]>
Change-Id: [insert-change-id-here] Change-Id: Ibe84196785ff3c9869feaa5de1ff60582aa2eea3 Co-developed-by: Cursor <[email protected]>
… files - Reordered and grouped import statements for better readability in main.py and tools.py. - Updated import statements to use consistent quotation styles. - Removed unnecessary blank lines and improved formatting for clarity. - Enhanced the organization of code in internal modules to align with best practices. This refactoring improves code maintainability and readability across the Google ADK instrumentation files. Change-Id: I3e9723b4870ea0f062a044ea7d2c6c1e7bee39da Co-developed-by: Cursor <[email protected]>
Change-Id: If5dbb7ad8f67a9e51ff95398b79f59982020bf5a Co-developed-by: Cursor <[email protected]>
Change-Id: I228fc9153b9066f096ae2a75906ca57f7f05dd91 Co-developed-by: Cursor <[email protected]>
59a3019 to
661a5da
Compare
- Introduced new Tox environments for testing and linting Google ADK instrumentation across multiple Python versions. - Updated GitHub Actions workflows to include jobs for linting and testing Google ADK instrumentation. - Added requirements files for both latest and oldest dependencies for Google ADK tests. - Enhanced error handling in main.py and improved logging for better debugging. This update enhances the testing framework and ensures comprehensive coverage for Google ADK instrumentation. Change-Id: [insert-change-id-here] Change-Id: I0013d216d47a9dd8146752ffb67d4cd18dfe3679 Co-developed-by: Cursor <[email protected]>
- Deleted coverage options and settings from pyproject.toml to streamline the configuration. - This change simplifies the testing setup and focuses on essential dependencies. Change-Id: [insert-change-id-here] Change-Id: Ia8956264c029b69e82a9ef1b737503fa3de2549d Co-developed-by: Cursor <[email protected]>
- Introduced new integration tests using pytest-vcr to record and replay real API interactions with the Google ADK. - Created fixtures in `conftest.py` for span, log, metric exporters, and tracer providers to facilitate testing. - Added multiple test cases to validate LLM chat functionality with and without content capture, ensuring compliance with OTel GenAI attributes. - Updated requirements files to include pytest-vcr and related dependencies for testing. - Documented the usage of VCR cassettes for recording and running tests. This enhancement improves the testing framework and ensures robust coverage for Google ADK instrumentation. Change-Id: [insert-change-id-here] Change-Id: I46e41e64288cc443f1757f3e3fa895561eb72532 Co-developed-by: Cursor <[email protected]>
Change-Id: I371d749769371cfa12cc1a6e6c53fb4aef5d2097 Co-developed-by: Cursor <[email protected]>
Change-Id: Ib89aa451a8b7dc142e054ca290286d1401c750ff Co-developed-by: Cursor <[email protected]>
Change-Id: I51ff02362a7c33c098fd75ff9f890e868d73c653 Co-developed-by: Cursor <[email protected]>
Change-Id: I5c6def57fb8c85c4ea93792a7328be9cef96abe3 Co-developed-by: Cursor <[email protected]>
Change-Id: Ic74c6d6f2ff38507bedc12dd074cb1fd1f193bd9 Co-developed-by: Cursor <[email protected]>
Change-Id: I367f1b8d9d1279c97b4e07e6dfb5b9ac93fc09e4 Co-developed-by: Cursor <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This resolves #35
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.